﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Mammoo.WebServer.Model;

namespace Mammoo.Web.share
{
    public partial class global_header : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SetMemberLink();
        }


        public void SetMemberLink()
        {
            string link = "";
            if (Session["member"] != null)
            {
                MemberInfo member = (MemberInfo)Session["member"];
                link += "<span>欢迎：";
                link += member.Member_Username;
                link += "，</span>";
                link += "<a href=\"#\" title=\"个人中心\">个人中心</a>";
                link += "<a href=\"/login.aspx?logout=true\" title=\"注销\">注销</a>";
            }
            else
            {
                link += "<a href=\"/login.aspx\">登录</a>";
                link += "<a href=\"/register.aspx\">注册</a>";
            }
            Lit_MemberInfo.Text = link;
        }
    }
}